<link rel="stylesheet" href="http://cdn.admui.com/demo/pjax/1.2.0/css/examples/components/advanced/scrollbar.css" id="siteStyle">
<script src="/static/public/vendor/bootstrap-multiselect/bootstrap-multiselect.js"></script>
<link rel="stylesheet" href="/static/public/vendor/bootstrap-multiselect/bootstrap-multiselect.css">
<title>优化成本</title>

<div class="page animation-fade">
    <div class="page-header page-header-bordered" style="position: relative;z-index:5;">
        <h1 class="page-title">优化成本</h1>
        <div class="page-header-actions">
            <select onchange="select()" name="prjId" data-plugin="selectpicker" multiple data-selected-text-format="count > 3" class>
                #foreach( $prj in $prjList )
                <option value="${prj.id}">${prj.depotName}</option>
                #end
            </select>
            <button type="button" class="btn btn-icon btn-info collapsed" data-toggle="collapse"
                    data-target="#collapseFilter" aria-expanded="false" aria-controls="collapseFilter">
                <i class="icon fa-filter"></i>
            </button>
        </div>
    </div>

    <div class="page-content">
        <div class="collapse" id="collapseFilter" aria-expanded="true">
            <div class="panel">
                <div class="panel-body">
                    <form class="form-horizontal" id="form">
                        <div class="form-group">
                            <div class="col-sm-3">
                                <label class="col-sm-4 control-label">处理时长</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" name="unitPrice" value="1.0">
                                </div>
                            </div>
                            <div class="col-sm-3">
                                <label class="col-sm-4 control-label">参数1</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" name="volume" value="1.0">
                                </div>
                            </div>
                            <div class="col-sm-3">
                                <label class="col-sm-4 control-label">参数2</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" name="load" value="100">
                                </div>
                            </div>
                            <div class="col-sm-5">
                                <a class="btn btn-success" onclick="reloadData()"><i class="icon fa-refresh"></i> 刷新
                                </a>
                            </div>

                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="row">
            <div class=" col-md-6" >
                <div class="panel panel-bordered">
                    <div class="panel-heading">
                        <h3 class="panel-title" style="line-height: 0.6;">二级配送中心点</h3>
                        <div class="panel-actions">

                        </div>
                    </div>
                    <div class="panel-body padding-3 height-350" style="width:100%">
                        #parse("/lpp/network/supply/response/map1.html")
                    </div>
                </div>
            </div>
            <div class=" col-md-6" >
                <div class="panel panel-bordered">
                    <div class="panel-heading">
                        <h3 class="panel-title" style="line-height: 0.6;">一级到二级的配送路线</h3>
                        <div class="panel-actions">

                        </div>
                    </div>
                    <div class="panel-body padding-3 height-350" style="width:100%">
                        #parse("/lpp/network/supply/response/map2.html")
                    </div>
                </div>
            </div>
            <div class=" col-ms-12 col-xs-12 col-md-2 " style="top: 20px;">
                <div class="panel panel-bordered">
                    <div class="panel-heading">
                        <h3 class="panel-title" style="line-height: 0.6;">可靠性参数值</h3>
                        <div class="panel-actions">

                        </div>
                        <div class="panel-body padding-3 height-450" style="width:100%;height: 400px;">
                            <table class="table table-bordered table-hover">
                                <tbody>
                                <tr>
                                    <td class="text-nowrap" style="font-size: 12px;">
                                        配送中心数
                                    </td>
                                    <td style="font-size: 12px;">
                                        233个
                                    </td>
                                </tr>
                                <tr>
                                    <td class="text-nowrap" style="font-size: 12px;">
                                        总花费
                                    </td>
                                    <td style="font-size: 12px;">
                                        2977万
                                    </td>
                                </tr>
                                <tr>
                                    <td class="text-nowrap" style="font-size: 12px;">
                                        车辆数
                                    </td>
                                    <td style="font-size: 12px;">
                                        3辆
                                    </td>
                                </tr>
                                <tr>
                                    <td class="text-nowrap" style="font-size: 12px;">
                                        配送中心数
                                    </td>
                                    <td style="font-size: 12px;">
                                        233个
                                    </td>
                                </tr>
                                <tr>
                                    <td class="text-nowrap" style="font-size: 12px;">
                                        总花费
                                    </td>
                                    <td style="font-size: 12px;">
                                        2977万
                                    </td>
                                </tr>
                                <tr>
                                    <td class="text-nowrap" style="font-size: 12px;">
                                        车辆数
                                    </td>
                                    <td style="font-size: 12px;">
                                        3辆
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            <div class=" col-md-10 col-ms-12 col-xs-12">
                <div class="example-wrap">
                    <div class="example" style="height: 427px;">
                        <div data-plugin="slimScroll" style="overflow: hidden; width: auto; height: 400px;">
                            <div class=" col-md-4">
                                <div class="panel panel-bordered">
                                    <div class="panel-heading">
                                        <h3 class="panel-title" style="line-height: 0.6;">到各二级配送中心运输费用</h3>
                                        <div class="panel-actions">

                                        </div>
                                    </div>
                                    <div  class="panel-body padding-3 height-300" style="width:100%">
                                        #parse("/lpp/network/supply/costing/bar1.html")
                                    </div>
                                </div>
                            </div>
                            <div class=" col-md-4">
                                <div class="panel panel-bordered">
                                    <div class="panel-heading">
                                        <h3 class="panel-title" style="line-height: 0.6;">一级配送中心1个月租赁成本</h3>
                                        <div class="panel-actions">

                                        </div>
                                    </div>
                                    <div class="panel-body padding-3 height-300" style="width:100%">
                                        <div  style="height: 100%">
                                            #parse("/lpp/network/supply/costing/bar2.html")
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class=" col-md-4">
                                <div class="panel panel-bordered">
                                    <div class="panel-heading">
                                        <h3 class="panel-title" style="line-height: 0.6;">一级配送中心安全库存水平(SS)</h3>
                                        <div class="panel-actions">

                                        </div>
                                    </div>
                                    <div class="panel-body padding-3 height-300" style="width:100%">
                                        <div style="height: 100%">
                                            #parse("/lpp/network/supply/costing/bar3.html")
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class=" col-md-4">
                                <div class="panel panel-bordered">
                                    <div class="panel-heading">
                                        <h3 class="panel-title" style="line-height: 0.6;">订货周期内的周转库存</h3>
                                        <div class="panel-actions">

                                        </div>
                                    </div>
                                    <div class="panel-body padding-3 height-300" style="width:100%">
                                        <div  style="height: 100%">
                                            #parse("/lpp/network/supply/costing/bar4.html")
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class=" col-md-4">
                                <div class="panel panel-bordered">
                                    <div class="panel-heading">
                                        <h3 class="panel-title" style="line-height: 0.6;">订货周期内的平均库存</h3>
                                        <div class="panel-actions">

                                        </div>
                                    </div>
                                    <div class="panel-body padding-3 height-300" style="width:100%">
                                        <div  style="height: 100%">
                                            #parse("/lpp/network/supply/costing/bar5.html")
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class=" col-md-4">
                                <div class="panel panel-bordered">
                                    <div class="panel-heading">
                                        <h3 class="panel-title" style="line-height: 0.6;">订货周期内库存商品占用资金水平</h3>
                                        <div class="panel-actions">

                                        </div>
                                    </div>
                                    <div class="panel-body padding-3 height-300" style="width:100%">
                                        <div  style="height: 100%">
                                            #parse("/lpp/network/supply/costing/bar6.html")
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class=" col-md-4">
                                <div class="panel panel-bordered">
                                    <div class="panel-heading">
                                        <h3 class="panel-title" style="line-height: 0.6;">一级配送中心1个月的平均库存</h3>
                                        <div class="panel-actions">

                                        </div>
                                    </div>
                                    <div class="panel-body padding-3 height-300" style="width:100%">
                                        <div  style="height: 100%">
                                            #parse("/lpp/network/supply/costing/bar7.html")
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class=" col-md-4">
                                <div class="panel panel-bordered">
                                    <div class="panel-heading">
                                        <h3 class="panel-title" style="line-height: 0.6;">占用车辆数量资源情况(各一级配送中心）</h3>
                                        <div class="panel-actions">

                                        </div>
                                    </div>
                                    <div class="panel-body padding-3 height-300" style="width:100%">
                                        <div  style="height: 100%">
                                            #parse("/lpp/network/supply/costing/bar8.html")
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class=" col-md-4">
                                <div class="panel panel-bordered">
                                    <div class="panel-heading">
                                        <h3 class="panel-title" style="line-height: 0.6;">运输成本（各一级配送中心）</h3>
                                        <div class="panel-actions">

                                        </div>
                                    </div>
                                    <div class="panel-body padding-3 height-300" style="width:100%">
                                        <div  style="height: 100%">
                                            #parse("/lpp/network/supply/costing/bar9.html")
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class=" col-md-4">
                                <div class="panel panel-bordered">
                                    <div class="panel-heading">
                                        <h3 class="panel-title" style="line-height: 0.6;">各一级配送中心1个月租赁成本分布</h3>
                                        <div class="panel-actions">

                                        </div>
                                    </div>
                                    <div class="panel-body padding-3 height-300" style="width:100%">
                                        <div  style="height: 100%">
                                            <!--         #parse("/lpp/network/supply/costing/bar10.html")-->
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class=" col-md-4">
                                <div class="panel panel-bordered">
                                    <div class="panel-heading">
                                        <h3 class="panel-title" style="line-height: 0.6;">订货周期内库存商品占用资金水平</h3>
                                        <div class="panel-actions">

                                        </div>
                                    </div>
                                    <div class="panel-body padding-3 height-300" style="width:100%">
                                        <div  style="height: 100%">
                                            <!--       #parse("/lpp/network/supply/costing/bar11.html")-->
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class=" col-md-4">
                                <div class="panel panel-bordered">
                                    <div class="panel-heading">
                                        <h3 class="panel-title" style="line-height: 0.6;">各一级配送中心1个月的平均库存分布</h3>
                                        <div class="panel-actions">

                                        </div>
                                    </div>
                                    <div class="panel-body padding-3 height-300" style="width:100%">
                                        <div  style="height: 100%">
                                            <!--       #parse("/lpp/network/supply/costing/bar12.html")-->
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div style="display:none;" id="trueShow"></div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<script>
    function select() {
        var selected=$("select[name='prjId']").val();
        // var selected=$("#prjId option:selected").text();
        $.ajax({
            url: "#springUrl('/network/supply/reliability/test1')",
            data: {"selected":selected.toString()},
            type: "post",
            success: function (text) {
                var d = JSON.parse(text);
                if (d.success && d.data) {
                    loadbar1(d.data);
                }else{
                    toastr.error(d.message);
                }
            },
        });

    }


    $(function () {
        // setTimeout("window.clearInterval(t1)",4000);
        build();
        //var t1=window.setInterval("build()",1000);

        // var trueShow=$("#trueShow").val();
        // if(trueShow==1){
        //    window.clearInterval(t1);
        //}
        //window.onunload(clearInterval(t1));

    });
    function buildTime() {

    }
    function build(){
        $.ajax({
            url: "#springUrl('/network/supply/costing/getAllData')",
            data: {"batchId": ""},
            type: "POST",
            //  async: false,
            success: function (text) {
                var d = JSON.parse(text);
                if (d.success && d.data &&d.data.arr1.length>=1) {
                    loadbar1(d);
                    loadbar2(d);
                    loadbar3(d);
                    loadbar4(d);
                    loadbar5(d);
                    loadbar6(d);
                    loadbar7(d);
                    loadbar8(d);
                    loadbar9(d);
                    // loadbar10(d);
                    // loadbar11(d);
                    // loadbar12(d);
                    $("#trueShow").val(1);
                    //window.clearInterval(t1);
                }else if(d.success && d.data){
                    toastr.success('算法正在处理，请等几分钟过来查看');
                }else{
                    toastr.error('没有数据，请上传配送中心数据');
                    var div1="<div type='text' style='padding-top:18%' class=' text-center '>"+d.message+"</div>";
                    document.getElementById('map1').innerHTML=div1;
                }
            }
        });
    }
</script>

